﻿using DotNetCore.CAP;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zy.Shared.Cap.Publisher
{
    /// <summary>
    /// Cap发布
    /// </summary>
    public class ZyCapPublisher(ICapPublisher publisher) : IZyCapPublisher
    {
        public async Task PublishAsync<T>(EventBase<T> eventData)
        {
            await publisher.PublishAsync(eventData.Name, eventData);
        }
    }
    public interface IZyCapPublisher
    {
        Task PublishAsync<T>(EventBase<T> eventData);
    }
}
